<?xml version="1.0" encoding="UTF-8"?>

<srv:container xmlns="http://symfony.com/schema/dic/security"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:srv="http://symfony.com/schema/dic/services"
    xsi:schemaLocation="http://symfony.com/schema/dic/services
        https://symfony.com/schema/dic/services/services-1.0.xsd
        http://symfony.com/schema/dic/security
        https://symfony.com/schema/dic/security/security-1.0.xsd">

    <config>
        <password_hasher class="JMS\FooBundle\Entity\User1" algorithm="plaintext" />

        <password_hasher class="JMS\FooBundle\Entity\User2" algorithm="sha1" encode-as-base64="false" iterations="5" />

        <password_hasher class="JMS\FooBundle\Entity\User3" algorithm="md5" />

        <password_hasher class="JMS\FooBundle\Entity\User4" id="security.hasher.foo" />

        <password_hasher class="JMS\FooBundle\Entity\User5" algorithm="pbkdf2" hash-algorithm="sha1" encode-as-base64="false" iterations="5" key-length="30" />

        <password_hasher class="JMS\FooBundle\Entity\User6" algorithm="native" time-cost="8" memory-cost="100" cost="15" />

        <password_hasher class="JMS\FooBundle\Entity\User7" algorithm="auto" />

        <provider name="default">
            <memory>
                <user identifier="foo" password="foo" roles="ROLE_USER" />
            </memory>
        </provider>

        <provider name="digest">
            <memory>
                <user identifier="foo" password="foo" roles="ROLE_USER, ROLE_ADMIN" />
            </memory>
        </provider>

        <provider name="basic">
            <memory>
                <user identifier="foo" password="0beec7b5ea3f0fdbc95d0dd47f3c5bc275da8a33" roles="ROLE_SUPER_ADMIN" />
                <user identifier="bar" password="0beec7b5ea3f0fdbc95d0dd47f3c5bc275da8a33" roles="ROLE_USER, ROLE_ADMIN" />
            </memory>
        </provider>

        <provider name="service" id="user.manager" />

        <provider name="chain">
            <chain providers="service, basic" />
        </provider>

        <firewall name="simple" pattern="/login" security="false" provider="default" />

        <firewall name="secure" stateless="true" provider="default" entry-point="form_login">
            <http-basic />
            <form-login />
            <switch-user />
            <x509 />
            <remote-user />
            <logout />
            <remember-me secret="TheSecret"/>
        </firewall>

        <firewall name="host" pattern="/test" host="foo\.example\.org" methods="GET,POST" provider="default">
            <http-basic />
        </firewall>

        <firewall name="with_user_checker" provider="default">
            <http-basic />
            <user-checker>app.user_checker</user-checker>
        </firewall>

        <role id="ROLE_ADMIN">ROLE_USER</role>
        <role id="ROLE_SUPER_ADMIN">ROLE_USER,ROLE_ADMIN,ROLE_ALLOWED_TO_SWITCH</role>
        <role id="ROLE_REMOTE">ROLE_USER,ROLE_ADMIN</role>

        <rule path="/blog/524" role="ROLE_USER" requires-channel="https" methods="get,POST" port="8000" />
        <rule role='IS_AUTHENTICATED_ANONYMOUSLY' path="/blog/.*" />
        <rule role='IS_AUTHENTICATED_ANONYMOUSLY' allow-if="token.getUserIdentifier() matches '/^admin/'" path="/blog/524" />
        <rule role="ROLE_ADMIN" route="admin">
            <attribute key="_controller">AdminController::index</attribute>
        </rule>
    </config>
</srv:container>
